package com.v.im.businessservice.bean;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "im_message", schema = "im", catalog = "")
public class ImMessageEntity {
    private int id;
    private String toId;
    private String fromId;
    private Long sendTime;
    private String content;
    private Character type;
    private Character readStatus;

    @Id
    @Column(name = "id")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    @Basic
    @Column(name = "to_id")
    public String getToId() {
        return toId;
    }

    public void setToId(String toId) {
        this.toId = toId;
    }

    @Basic
    @Column(name = "from_id")
    public String getFromId() {
        return fromId;
    }

    public void setFromId(String fromId) {
        this.fromId = fromId;
    }

    @Basic
    @Column(name = "send_time")
    public Long getSendTime() {
        return sendTime;
    }

    public void setSendTime(Long sendTime) {
        this.sendTime = sendTime;
    }

    @Basic
    @Column(name = "content")
    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    @Basic
    @Column(name = "type")
    public Character getType() {
        return type;
    }

    public void setType(Character type) {
        this.type = type;
    }

    @Basic
    @Column(name = "read_status")
    public Character getReadStatus() {
        return readStatus;
    }

    public void setReadStatus(Character readStatus) {
        this.readStatus = readStatus;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        ImMessageEntity that = (ImMessageEntity) o;
        return id == that.id &&
                Objects.equals(toId, that.toId) &&
                Objects.equals(fromId, that.fromId) &&
                Objects.equals(sendTime, that.sendTime) &&
                Objects.equals(content, that.content) &&
                Objects.equals(type, that.type) &&
                Objects.equals(readStatus, that.readStatus);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, toId, fromId, sendTime, content, type, readStatus);
    }
}
